/*
 * This class creates the program to test the banking classes.
 * It creates a new Bank, sets the Customer (with an initial balance),
 * and performs a series of transactions with the Account object.
 * 此类创建程序来测试 banking 类。
 * 它创建一个新的 Bank，设置 Customer（具有初始余额），
 * 并使用 Account 对象执行一系列交易。
 */

import banking.*;

public class TestBanking02 {

  public static void main(String[] args) {
//    System.out.println("Creating the customer Jane Smith .");
    System.out.println("创建客户 Jane Smith .");
    Customer customer= new Customer("Jane", "Smith");
    //code
    // Create an account that can has a 500.00 balance.
    // 创建一个余额为 500.00 的账户。
    System.out.println("创建一个余额为 500.00 的账户。");
    customer.setAccount(new Account(500.00));
//    System.out.println("Creating her account with a 500.00 balance.");
    //code
    // 提款 150.00
    System.out.println("Withdraw 150.00");
    customer.getAccount().withdraw(150.00);
	//code
    // 存款 22.50
    System.out.println("Deposit 22.50");
    customer.getAccount().deposit(22.50);
  	//code
    // 提款 47.62
    System.out.println("Withdraw 47.62");
    customer.getAccount().withdraw(47.62);
   	//code
    // Print out the final account balance
    // 打印出最终账户余额
    // 客户 [“ + customer.getLastName（） + ”， “ + customer.getFirstName（） + ”] 的余额为 “ + account.getBalance（）
    System.out.println("Customer [" + customer.getLastName()
		       + ", " + customer.getFirstName()
		       + "] has a balance of " + customer.getAccount().getBalance());
  }
}
